package nu.aing.P20140519;

/**
 * @author memekmaut@gmail.com
 */
public class RainyRoad {
    
    public static final String[] EX0 = new String[] {
        ".W.." ,
        "...."
    };
    public static final String[] EX1 = new String[] {
        ".W..",
        "..W."
    };
    public static final String[] EX2 = new String[] {
        ".W..W..",
        "...WWW."
    };
    public static final String[] EX3 = new String[] {
        "..",
        "WW"
    };
    public static final String[] EX4 = new String[] {
        ".WWWW.",
        "WWWWWW"
    };
    public static final String[] EX5 = new String[] {
        ".W.W.W.",
        "W.W.W.W"
    };
    public static final String[] EX6 = new String[] {
        ".............................................W.",
        ".............................................W."
    };
    
    public static void main(String[] args) {
        System.out.println(isReachable(EX0) );
        System.out.println(isReachable(EX1) );
        System.out.println(isReachable(EX2) );
        System.out.println(isReachable(EX3) );
        System.out.println(isReachable(EX4) );
        System.out.println(isReachable(EX5) );
        System.out.println(isReachable(EX6) );
    }
    
    public static String isReachable(String[] road) {
        for(int i = 0; i < road[0].toCharArray().length; i++) {
            if(road[0].charAt(i) == 'W' && road[1].charAt(i) == 'W') {
                return "NO";
            }
        }
        return "YES";
    }
}
